#ifndef NUTSTORE_UTIL_H
#define NUTSTORE_UTIL_H

#include <glib.h>
#include <glib/gprintf.h>

G_BEGIN_DECLS

#ifdef _DEBUG

#define debug_enter() {g_print("Entering "); g_print(__FUNCTION__); g_printf("\n");}
#define debug(format, ...) {g_print(__FUNCTION__); g_print(": "); \
    g_printf(format, ## __VA_ARGS__); g_print("\n");}
#define debug_return(v) {g_print("Exiting "); g_print(__FUNCTION__); g_printf("\n"); return v;}

#else

#define debug_enter() do {} while(0)
#define debug(format, ...) do {} while(0)
#define debug_return(v) do {} while(0)

#endif

gchar *nutstore_util_sanitize(const gchar *a);
gchar *nutstore_util_desanitize(const gchar *a);

gboolean nutstore_util_command_parse_arg(const gchar *line, 
        GHashTable *return_table);

G_END_DECLS

#endif
